from rest_framework import serializers
from .models import User, Merchants, Application


class UserSettin(serializers.ModelSerializer):
    user_name = serializers.SerializerMethodField()

    def get_user_name(self, obj):
        return obj.merchan.name

    class Meta:
        models = User
        fields = '__all__'


class ApplicaSettin(serializers.ModelSerializer):
    class Meta:
        models = Application
        fields = '__all__'


class MerchantSettin(serializers.ModelSerializer):
    class Meta:
        models = Merchants
        fields = '__all__'
